﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using StockCommon;
using Utilities;
using StockImport.TaskLog;

namespace StockImport.dataimport
{
    public abstract class HttpContentFetcher
    {
        public abstract bool suitableForDate(DateTime d);
        public abstract String getTaskName();
        public abstract String getVersion();

        protected static String replaceYMD(String s, DateTime date)
        {
            YMD ymd = DateUtils.getYMD(date);
            s = s.Replace("${yyyy}", ymd.yyyy);
            s = s.Replace("${MM}", ymd.MM);
            s = s.Replace("${yy}", ymd.yy);
            s = s.Replace("${dd}", ymd.dd);
            return s;
        }
        protected static bool islogComplete(ObjectExecLog exelog)
        {
            if (LogStatus.sUpdated.Equals((LogStatus)exelog.status))
            {
                if (LogResult.rComplete.Equals((LogResult)exelog.result))
                {
                    return true;
                }
            }
            return false;
        }
    }
}
